import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { AnalysisDto } from '../core/models';

@Injectable({
  providedIn: 'root',
})
export class PurchaseOrderSyncService {
  apiName = 'BasicArchives';
  

  analyze = (start: string, end: string) =>
    this.restService.request<any, AnalysisDto>({
      method: 'POST',
      url: '/api/basic-archives/purchase-order-sync/analyze',
      params: { start, end },
    },
    { apiName: this.apiName });
  

  createByIds = (ids: number[], start: string, end: string) =>
    this.restService.request<any, number>({
      method: 'POST',
      url: '/api/basic-archives/purchase-order-sync/create-by-ids',
      params: { start, end },
      body: ids,
    },
    { apiName: this.apiName });
  

  getSyncedIdsByStartAndEnd = (start: string, end: string) =>
    this.restService.request<any, number[]>({
      method: 'GET',
      url: '/api/basic-archives/purchase-order-sync/synced-ids',
      params: { start, end },
    },
    { apiName: this.apiName });
  

  getUnasyncIdsByStartAndEnd = (start: string, end: string) =>
    this.restService.request<any, number[]>({
      method: 'GET',
      url: '/api/basic-archives/purchase-order-sync/unasync-ids',
      params: { start, end },
    },
    { apiName: this.apiName });
  

  updateByIds = (ids: number[], start: string, end: string) =>
    this.restService.request<any, number>({
      method: 'POST',
      url: '/api/basic-archives/purchase-order-sync/update-by-ids',
      params: { start, end },
      body: ids,
    },
    { apiName: this.apiName });

  constructor(private restService: RestService) {}
}
